<!DOCTYPE html>
<style>
html,body {
    margin: 0;
    padding: 0;
}
.container {
    height: 50px;
    width: 50px;
    background-color: orange;
    border: 1px solid;
}
.child {
    margin: 20%;
    height: 10px;
    width: 10px;
    background-color: salmon;
}
</style>
<div class="container">
    <div class="child"></div>
</div>
<br>
<div class="container" style="overflow:scroll">
    <div class="child"></div>
</div>
